
package com.joysuch.wwyt.mh.service;

import com.joysuch.wwyt.bp.bean.BpMonitoringPointBean;
import com.joysuch.wwyt.bp.entity.BpDeviceFacilityCollection;
import com.joysuch.wwyt.core.common.ajax.ResultBean;
import com.joysuch.wwyt.core.exception.ApiBusinessException;
import com.joysuch.wwyt.mh.bean.MhMonitoringPointBean;
import com.joysuch.wwyt.mh.bean.MhMonitoringPointListBean;
import com.joysuch.wwyt.mh.bean.MhMonitoringPointReqBean;
import com.joysuch.wwyt.mh.dto.MhMonitoringPointDto;
import com.joysuch.wwyt.mh.entity.MhMonitoringPoint;
import com.joysuch.wwyt.mh.entity.MhMonitoringType;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface MhMonitoringPointService {

    void add(MhMonitoringPoint mhMonitoringPoint);

    List<MhMonitoringPoint> findAll(Long tenantId, String orgCode);

    void edit(MhMonitoringPoint mhMonitoringPoint);

    Page<MhMonitoringPointListBean> list(Pageable pageable, String nameOrCode, String pointCode, Long monitoringTypeId, Long category, Integer showFlag,Integer filter, Integer status);

    Page<MhMonitoringPointListBean> page(Pageable pageable, String name, String pointCode, Long monitoringTypeId, Long categoryId);

    /**
     * 找到指定监测类型的已绑定的监测点
     *
     * @param type 监测类型
     * @return
     */
    public List<MhMonitoringPoint> findBindedPointsByType(MhMonitoringType type);

    /**
     * 找到指定监测类型名称的已绑定的监测点
     *
     * @param typeName 监测类型名称
     * @return
     */
    public List<MhMonitoringPoint> findBindedPointsByTypeName(String typeName);

    public List<MhMonitoringPoint> findBindedPointsByTypeNameLike(String typeName);

    public BpDeviceFacilityCollection findMonitoringPointBindToDevice(Long pointId);

    MhMonitoringPointBean getById(Long id);

    List<MhMonitoringPointBean> findByIds(List<Long> ids);

    BpMonitoringPointBean getByIds(Long id);

    Double realTimeVal(MhMonitoringPoint p);

    public long countAll();

    void changeState(Long id, int state);

    ResultBean deleteById(Long id);

    String checkMhMointPoint(Long mhPointId, Long refId);

    void deletePoints(List<Long> ids);

    List<MhMonitoringPoint> findByResponsibleDept();

    /**
     * 获取检测点详细数据
     * @param id
     * @return
     */
    MhMonitoringPointDto getMhMonitoringPointById(Long id) throws ApiBusinessException;

    /**
     * 获取拥有位置的监测点数量
     * flag  0 : 所有数量 1: 拥有位置的数量
     * @return
     */
    Long getNumForHaveLocation(Integer flag);

    /**
     * 查询所有有位置的风险点
     * @return
     */
    List<MhMonitoringPoint> findAllHaveLocation();

    /**
     * 批量开关 设备监测点
     * @param bean
     */
    void batchSwitch(MhMonitoringPointReqBean bean);

   /* List<MhMonitoringPoint> findNoxiousGas();

    List<MhMonitoringPoint> findInflammableAandExplosiveGas();*/
}
